package com.hrb.douban.activtity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.hrb.douban.R;
import com.hrb.douban.activtity.base.BaseActivity;
import com.hrb.douban.activtity.setting.CheckLargeImageActivity;
import com.hrb.douban.activtity.setting.InfoActivity;
import com.hrb.douban.activtity.setting.SocketActivity;
import com.hrb.douban.mview.CustomTitleBar;
import com.hrb.douban.mview.loading.LoadingView;
import com.hrb.douban.utils.ToastUtil;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PersonInfoActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.custom_title_bar)
    CustomTitleBar customTitleBar;
    @BindView(R.id.person_message)
    CustomTitleBar mpersonMessage;
    @BindView(R.id.phone_message)
    CustomTitleBar mphoneMessage;
    @BindView(R.id.clear_message)
    CustomTitleBar mclearMessage;
    @BindView(R.id.update_message)
    CustomTitleBar mupdateMessage;
    @BindView(R.id.about)
    CustomTitleBar mabout;
    @BindView(R.id.view_large_image)
    CustomTitleBar mviewLargeImage;
    @BindView(R.id.loading_view)
    LoadingView loadingView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_person_info);
        ButterKnife.bind(this);
        loadingView.start();
        customTitleBar.getMtitle().setText(getIntent().getStringExtra("title"));
        customTitleBar.setTitleClickListener(this);
        mpersonMessage.getMrBtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.show("1");
                Intent intent = new Intent(getApplicationContext(), InfoActivity.class);
                intent.putExtra("title", "个人资料");
                startActivity(intent);
            }
        });
        mphoneMessage.getMrBtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.show("2");
            }
        });
        mclearMessage.getMrBtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtil.show("3");
            }
        });
        mupdateMessage.getMrBtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
        mabout.getMrBtn().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getApplicationContext(), SocketActivity.class);
                intent.putExtra("title", "关于");
                startActivity(intent);
            }
        });
        mviewLargeImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getApplicationContext(), CheckLargeImageActivity.class);
                intent.putExtra("title", "浏览大图");
                startActivity(intent);
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.title_bar_left:
                loadingView.stop();
                finish();
                break;
            case R.id.title_bar_right:
                break;
        }
    }
}
